package com.uchiha.nova.core.launch;


import com.uchiha.nova.core.service.AutoService;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.core.Ordered;

import java.util.Properties;

/**
 * @author 周林静
 * @Date 2021-10-26 9:20
 * @Version 1.0
 */
@AutoService(LauncherService.class)
public class LogLauncherServiceImpl implements LauncherService {
    @Override
    public void launcher(SpringApplicationBuilder builder, String appName, String profile, boolean isLocalDev) {
        Properties props = System.getProperties();
        props.setProperty("logging.config", "classpath:log/logback-" + profile + ".xml");
    }

    @Override
    public int getOrder() {
        return Ordered.HIGHEST_PRECEDENCE;
    }
}
